class Point {
  x = 0;
  y = 0;
  constructor(x: number, y: number) {
    this.x = x;
    this.y = y;
  }
  scale (n: number) {
    this.x *= n;
    this.y *= n;
  }
}

const pt = new Point(1, 2);
pt.scale(2);
console.log(pt.x, pt.y);